program main
! 作者：何光辉,
! 邮箱：flamehe@163.com
    use DQ
    implicit none
    integer(4),parameter :: iwp=16
    integer(4), parameter :: maxorder = 3
    integer(4) :: i, j, k, n
    real(iwp) :: xlist(9)
    real(iwp), allocatable :: c(:,:,:)
    
    xlist = [-1.0_iwp, -0.75_iwp, -0.5_iwp, -0.25_iwp, 0.0_iwp, 0.25_iwp, 0.5_iwp,0.75_iwp, 1.0_iwp]
    n = ubound(xlist,1); allocate( c(0:maxorder,n,n) )
    call DQCoeff(xlist, maxorder,c)
    
    open(unit = 10, file = "res.txt")
    
    do k=0,maxorder
        write(10,"(a8, i2)") "order= ", k
        write(10, 100 ) ((c(k,i,j),j=1,n),i=1,n)
    end do
    
100 format (9(f20.13))
 
end program main